package com.easylinkin.linkappapi.crane.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.easylinkin.linkappapi.common.model.RequestModel;
import com.easylinkin.linkappapi.crane.entity.CraneVerticalProtectionArea;
import com.easylinkin.linkappapi.crane.mapper.CraneVerticalProtectionAreaMapper;
import com.easylinkin.linkappapi.crane.service.ICraneVerticalProtectionAreaService;
import com.easylinkin.linkappapi.security.context.LinkappUserContextProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 吊车垂直面保护区表 服务实现类
 *
 * @author xy
 * @since 2025-06-16
 */
@Service
public class CraneVerticalProtectionAreaServiceImpl extends ServiceImpl<CraneVerticalProtectionAreaMapper, CraneVerticalProtectionArea> implements ICraneVerticalProtectionAreaService {

    @Autowired
    private LinkappUserContextProducer linkappUserContextProducer;

    @Override
    public IPage<CraneVerticalProtectionArea> queryPageList(RequestModel<CraneVerticalProtectionArea> requestModel) {
        CraneVerticalProtectionArea customQueryParams = requestModel.getCustomQueryParams();
        if (customQueryParams == null) {
            customQueryParams = new CraneVerticalProtectionArea();
        }
        customQueryParams.setTenantId(linkappUserContextProducer.getTenantId());
        return baseMapper.queryPageList(requestModel.getPage(), customQueryParams);
    }
}